package talk.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.text.TextUtils;
import android.widget.TextView;

import com.gyf.barlibrary.ImmersionBar;
import com.talk.debby.talk.R;

/**
 * Created by debby on 2018/4/4.
 * 描述:聊天界面
 */

public class ConversationActivity extends FragmentActivity {

    private String name;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_conversation);
        getExtra();
        initView();
    }

    private void initView() {
        if (!TextUtils.isEmpty(name)) {
            TextView tv_title = findViewById(R.id.tv_title);
            tv_title.setText(name);
        }
    }

    private void getExtra() {
        name = getIntent().getData().getQueryParameter("title");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        initTitleBar(false);
    }

    private ImmersionBar mImmersionBar;

    private void initTitleBar(Boolean isInit) {
        if (isInit) {
            mImmersionBar = ImmersionBar.
                    with(this)
                    .statusBarDarkFont(false);
            mImmersionBar.init();   //所有子类都将继承这些相同的属性
        } else {
            if (mImmersionBar != null)
                mImmersionBar.destroy();
        }
    }

}
